﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DE_MVC_WyFy.Models
{
	public class PageInfo
	{
		public int TotalPage { get {
			return (int)(TotalItem / PageSize) + (TotalItem % PageSize == 0 ? 0 : 1);
		} }
		public int TotalItem { get; set; }
		public int PageSize { get; set; }
		public int Current { get; set; }
		public String Url { get; set; }
		public int Next { get {
			return (Current == Last) ? -1 : Current + 1;
		} }
		public int Preview
		{
			get
			{
				return Current == First ? -1 : Current - 1;
			}
		}
		public int First { get { return 1; } }
		public int Last { get { return TotalPage; } }
	}
}